package st.business.tepth.business.user.busnumber.workholder.maintain.pass;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import st.business.tepth.business.bean.MaintainPassInfoBean;
import st.business.tepth.business.user.busnumber.workholder.maintain.pass.content.ContentDelegate;
import st.business.tepth.config.ItemFields;
import st.shadow.library.ui.recycler.MultipleItemEntity;

/**
 * @author zhangyu
 * @date 2019/4/19
 */
public class MaintainContentAdapter extends FragmentPagerAdapter {
    private List<MultipleItemEntity> mMultipleItemEntities;
    public MaintainContentAdapter(FragmentManager fm,
                                  List<MultipleItemEntity> multipleItemEntities) {
        super(fm);
        mMultipleItemEntities = multipleItemEntities;
    }

    @Override
    public Fragment getItem(int i) {
        return ContentDelegate.newInstance((MaintainPassInfoBean)
                mMultipleItemEntities.get(i).getField(ItemFields.ITEM_OBJ));
    }

    @Override
    public int getCount() {
        return mMultipleItemEntities.size();
    }

}
